package com.jied.duodian.web.qt;

import com.jied.duodian.entity.DdLeibie;
import com.jied.duodian.entity.DdProduct;
import com.jied.duodian.service.Impl.DdLeibieServiceImpl;
import com.jied.duodian.service.custom.DUProductservice;
import com.jied.duodian.util.CommonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Description:
 * 前台排序
 *
 * @author LiJie
 * @date Created on 2020/11/1
 * WWW https://github.com/j6l
 */
@RestController
@RequestMapping("/px")
@Slf4j
public class MaoController {


    @Autowired
    DdLeibieServiceImpl ddLeibieService;
    @Autowired
    DUProductservice duProductservice;


    /**
     * 获取商品的品牌
     *
     * @return
     */
    @PostMapping("/brand")
    public CommonResult getbrandname() {
        List<DdProduct> list = duProductservice.getbrandname();
        return CommonResult.success( list );
    }

    /**
     * 商品子类别
     *
     * @return
     */
    @PostMapping("/lei")
    public CommonResult getleiname() {
        List<DdLeibie> leiname = ddLeibieService.getLeibieBYshuxing();
        return CommonResult.success( leiname );
    }

}
